package com.ccs;

import java.util.Random;

public class multChoice {
	
	public String[] questions= new String[5];
	public String[][] choices= new String[5][4];
	public String[] rQuest= new String[3];
	public String[][] rChoices= new String[3][4];
	public Random randMc = new Random();
	private int[] checker = new int[3];
	private int checkIndex;
	
	public multChoice()
	{
		questions[0]="Defines the starting and ending point of a smooth transition";
		questions[1]="It is a feature in Flash which allows objects to move automatically";
		questions[2]="It is a way of selectively blocking areas of a layer";
		questions[3]="An Object that you create in Flash";
		questions[4]="It organizes and controls a document's content over time in layers and frames";
		
		choices[0][0]="key frame";
		choices[0][1]="pointer";
		choices[0][2]="layer";
		choices[0][3]="library";
		
		choices[1][0]="motion tween";
		choices[1][1]="motion pointer";
		choices[1][2]="paint bucket";
		choices[1][3]="stop();";
		
		choices[2][0]="eraser";
		choices[2][1]="free transform tool";
		choices[2][2]="masking";
		choices[2][3]="overlap";
		
		choices[3][0]="picture";
		choices[3][1]="class";
		choices[3][2]="symbol";
		choices[3][3]="assets";
		
		choices[4][0]="layer";
		choices[4][1]="timeline";
		choices[4][2]="component";
		choices[4][3]="panel";
		
		for ( int i = 0; i < 3; i++ ){
            checker[i] = 5;
        }

        checkIndex = 0;

        this.randomizeMC();
        this.makeQuery();
		
		
	}
	
	private void randomizeMC(){
        int x = -1;
        boolean check = true;

        while ( checkIndex < 3 ){
            x = randMc.nextInt(4);

            for ( int i = 0; i < 3; i++ ){
                if ( getChecker()[i] == x ){
                    check = false;
                    break;
                }
                check = true;
            }

            if ( check == true ){
                checker[checkIndex] = x;
                checkIndex++;
            }
        }
    }
	
	 public int[] getChecker() {
	        return checker;
	 }
	 
	public void makeQuery()
	{
		
		for(int i=0;i<3;i++)
		{
			rQuest[i]=questions[checker[i]];
			
			for(int j=0;j<4;j++)
			{
			rChoices[i][j]=choices[checker[i]][j];
			}
		}
	}
	
	public String[] getQuestions()
	{
		return this.rQuest;
	}
	public String[][] getChoices()
	{
		return this.rChoices;
	}
}
